using System;
using System.Data;
using System.Collections.Generic;
using System.Text;

using AIFSDataAccessLayer.Utilities;

namespace AIFSContentManagementSystem.DomainObjects.Mapper
{
    public class FragmentMapper : DtoMapper<Fragment>
    {
        protected override void Map(DataRow drEntity, Fragment dto)
        {
            dto.FragmentId = DataTableUtil.ToIntType(drEntity, "FRAGMENT_ID");
            dto.HeaderText = DataTableUtil.ToStringType(drEntity, "HEADER_TEXT");
            dto.HtmlBody = DataTableUtil.ToStringType(drEntity, "HTML_BODY");
            dto.Image = new Image();
            dto.Image.AltText = DataTableUtil.ToStringType(drEntity, "IMAGE_ALT_TEXT");
            dto.Image.Url = DataTableUtil.ToStringType(drEntity, "IMAGE_URL");            
        }
    }
}
